<div class="panel-body">
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <g:sortableColumn property="fileUrl" title="照片"/>
                <g:sortableColumn property="fileName" title="名称"/>
                <g:sortableColumn property="type" title="类型"/>
                <g:sortableColumn property="fileUrl" title="链接"/>
                <!--<g:sortableColumn property="createdDate" title="创建时间"/>
                <g:sortableColumn property="modifiedDate" title="修改时间"/>-->
                <g:sortableColumn  class="text-center" width="10%" colspan="2" property="active" title="操作"/>
            </tr>
            </thead>
            <tbody>
            <g:each in="${attachmentList}">
                <tr>
                    <td><image src="${it?.fileUrl}" class="img-circle" alt="logo" width="42" height="42"/></td>
                    <td><a href="" class="firstTd btn ${it?.fileUrl == it?.product?.imageUrl ? 'btn-success': ''} btn-xs">${it?.fileName}</a></td>
                    <td>${it?.type?.name}</td>
                    <td>${it?.fileUrl}</td>
                    <!--<td><g:formatDate date="${it?.createdDate}"format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                    <td><g:formatDate date="${it?.modifiedDate}"format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>-->
                    <td class="text-center">
                        <g:form controller="product" action="setToMainPicture" id="${it?.id}">
                            <button class="confirmBtn btn btn-xs btn-link" type="button"><i class="fa fa-edit"></i></i> 设置为主图片</button>
                        </g:form>
                    </td>
                    <td class="text-center">
                        <g:form controller="product" action="deleteAttachment" id="${it?.id}">
                            <button class="deleteBtn btn btn-xs btn-link" type="button"><i class="fa fa-trash-o"></i> 删除</button>
                        </g:form>
                    </td>
                </tr>
            </g:each>
            </tbody>
        </table>
    </div>
</div>
